import Vue from 'vue';
import Router from 'vue-router';

Vue.use(Router);

export default new Router({
    routes: [
        {
            path: '/',
            redirect: '/login'
        },
        {
            path: '/',
            component: () => import(/* webpackChunkName: "home" */ '../components/common/Home.vue'),
            meta: { title: '自述文件' },
            children: [
                {
                    // 系统首页
                    path: '/dashboard',
                    component: () => import(/* webpackChunkName: "dashboard" */ '../components/page/Dashboard.vue'),
                    meta: { title: '系统首页' }
                },
                {
                    // 订单管理
                    path: '/orderManage',
                    component: () => import(/* webpackChunkName: "icon" */ '../components/page/OrderManage.vue'),
                    meta: { title: '订单管理' }
                },
                {
                    // 用户管理
                    path: '/addUser',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/AddUser.vue'),
                    meta: { title: '新增用户' }
                },
                {
                    // 用户列表
                    path: '/userList',
                    component: () => import(/* webpackChunkName: "table" */ '../components/page/UserList.vue'),
                    meta: { title: '用户列表' }
                },
                {
                    //
                    path: '/deptList',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/DeptList.vue'),
                    meta: { title: '部门列表' }
                },
                {
                    //
                    path: '/addDept',
                    component: () => import(/* webpackChunkName: "tabs" */ '../components/page/AddDept.vue'),
                    meta: { title: '新增部门' }
                },
                {
                    // 专题推荐
                    path: '/topicRecom',
                    component: () => import(/* webpackChunkName: "form" */ '../components/page/TopicRecom.vue'),
                    meta: { title: '专题推荐' }
                },
                {
                    // 广告列表
                    path: '/adList',
                    component: () => import(/* webpackChunkName: "editor" */ '../components/page/AdList.vue'),
                    meta: { title: '广告列表' }
                },
                {
                    //
                    path: '/addEmployee',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/AddEmployee.vue'),
                    meta: { title: '新增店员' }
                },
                {
                    //
                    path: '/empManage',
                    component: () => import(/* webpackChunkName: "i18n" */ '../components/page/EmpList.vue'),
                    meta: { title: '店员管理' }
                },
                {
                    // 新增商品
                    path: '/addProduct',
                    component: () => import(/* webpackChunkName: "permission" */ '../components/page/AddProduct.vue'),
                    meta: { title: '新增商品', permission: true }
                },
                {
                    path: '/productList',
                    component: () => import(/* webpackChunkName: "404" */ '../components/page/ProductList.vue'),
                    meta: { title: '商品列表' }
                },
                {
                    path: '/brandList',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/BrandList.vue'),
                    meta: { title: '品牌列表' }
                },
                {
                    path: '/addBrand',
                    component: () => import(/* webpackChunkName: "donate" */ '../components/page/AddBrand.vue'),
                    meta: { title: '新增品牌' }
                }
            ]
        },
        {
            path: '/login',
            component: () => import(/* webpackChunkName: "login" */ '../components/page/Login.vue'),
            meta: { title: '登录' }
        },
        {
            path: '*',
            redirect: '/404'
        }
    ]
});
